import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:router/annotation.dart';

@RouterConfig(WebViewPage.pageName)
class WebViewPage extends StatefulWidget {
  static const pageName = '/webViewPage';

  @Autowired()
  final String url;

  @Autowired()
  final String title;

  const WebViewPage({
    Key key,
    this.url,
    this.title,
  }) : super(key: key);

  @override
  _WebViewPageState createState() => _WebViewPageState();
}

class _WebViewPageState extends State<WebViewPage> {
  @override
  Widget build(BuildContext context) {
    return WebviewScaffold(
      url: widget.url,
      appBar: CenterTitleAppBar(
        title: widget.title,
      ),
    );
  }
}
